package com.alibaba.yinan.domain.task.service.validator;

import com.alibaba.yinan.domain.task.Task;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName DispatchValidatorChain
 * @Author mengke
 * @create 2025/8/3 21:41
 * @Description
 */
@Component
@RequiredArgsConstructor
public class DispatchValidatorChain {

    private final List<DispatchValidator> validators;

    public void validate(Task task) {
        for (DispatchValidator validator : validators) {
            validator.validate(task);
        }
    }
}
